﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected string GetModuleName(DataRow record)
{
	DataRow[] rows = ModuleTable.Select(Alias.Module.Namespace + "='" + record[Alias.Template.Module.ModuleID] + "'");
	if (rows.Length == 0)
		return String.Empty;
	else
		return rows[0][Alias.Module.Label].ToString();
}
</script>
<section data-page="template_module_list" data-title="模块邦定" data-lang="<%=ContentLang%>" data-template-path="<%=Request.QueryString["TemplatePath"]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="list.aspx" target="ali-navtab">模板列表</a> → <%=Request.QueryString["TemplatePath"]%></dt>
	</dl>
	<div class="ali-tabs sub-nav" data-height-style="fill" data-event="click">
		<div class="ali-tabs-header">
			<div class="ali-tabs-nav-container">
				<ul>
					<li><a href="edit.aspx?Path=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">编辑</a></li>
					<li><a href="dictionary.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">词典</a></li>
					<li class="ali-active"><a>模块邦定</a></li>
					<li><a href="pages/list.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">页面列表</a></li>
					<li><a href="pages/add.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">添加页面</a></li>
					<li><a href="script/list.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">脚本列表</a></li>
					<li><a href="script/add.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">添加脚本</a></li>
					<li><a href="menu/list.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">模块菜单</a></li>
					<li><a href="menu/add.aspx?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" target="ali-navtab">添加菜单</a></li>
				</ul>				
			</div>
		</div>
		<div class="ali-tabs-body">
			<div class="ali-tabs-panel"></div>
			<div class="ali-tabs-panel"></div>
			<div class="ali-tabs-panel">
				<form action="?TemplatePath=<%=Request.QueryString["TemplatePath"]%>" class="search1" style="display:none"><button type="submit" class="ali-button">搜索</button></form>
				<form action="" class="add1">
					模块：
					<select name="ModuleID" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
						<option value="">-- 非功能 --</option>
						<ali:List ID="ModuleTable" Object="Module">
							<ali:Record>
								<option value="<%=Namespace%>"><%=Label%></option>
							</ali:Record>
						</ali:List>
					</select>
					标志：<input type="text" name="Mark" class="ali-input">
					<label><input type="checkbox" name="JustData">只是数据</label>
					<button type="submit" class="ali-button">添加</button>
				</form>
				<div class="content">
					<table data-ali-widget="grid" class="grid1">
						<thead>
							<tr>
								<th>模块</th>
								<th>标志</th>
								<th>只是数据</th>
								<th width="80">删除</th>
							</tr>
						</thead>
						<tbody>
							<ali:List Object="Template.Module" Condition="TemplatePath=Request.QueryString['TemplatePath']" Validate="True">
								<ali:Record>
									<tr data-id="<%=Mark%>">
										<td><%=GetModuleName(Record)%></td>
										<td><%=Mark%></td>
										<td><%=JustData%></td>
										<td><a href="" class="ali-button" data-operation="Delete">删除</a></td>
									</tr>
								</ali:Record>
							</ali:List>
						</tbody>
					</table>
				</div>
			</div>
		</div>
		<div class="ali-tabs-bottom"><b></b></div>
	</div>
</section>